package com.jiemengshi.server.controller;

import com.alibaba.fastjson.JSONObject;
import com.jiemengshi.server.util.ApiResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by MingQi on 2017/10/12.
 */
@Controller
@RequestMapping(value = {"/admin/version"}, produces = {"application/json;charset=UTF-8"})
public class VersionController {
    private Logger log = LoggerFactory.getLogger(this.getClass());
    
    @ResponseBody
    @RequestMapping("/id")
    public String getVersionId(HttpServletRequest request){
        log.debug("session_id --> " + request.getSession().getId());
        
        JSONObject versionId = new JSONObject();
        versionId.put("versionId", "1");
        
        return ApiResult.writeData(versionId);
    }
}
